/**
 *    @file       threadcore.h
 *
 *    @brief      
 *    @details
 *
 *    @version    1.0
 *    @date       12/19/2012 03:34:46 PM
 *
 *    @author     Theophilus (), wangtf418@gmail.com
 */
#ifndef _BF_THREADCORE_H_
#define _BF_THREADCORE_H_
#include "comdef.h"

class threadcore
{
public:
	threadcore();
	virtual ~threadcore();

public:
	virtual bf_int_t start();
	virtual void stop();
	virtual bf_int_t init() = 0;
	virtual bf_int_t run() = 0;
	
public:
	bf_pid_t get_processid()
	{
		return m_processid;
	}

	bf_pthread_t get_threadid()
	{
		return m_threadid;
	}

protected:
	static void* thread_entry(void *arg);

protected:
	volatile bf_int_t m_runflag;
	bf_pid_t m_processid;
	bf_pthread_t m_threadid;
};

#endif

